package com.gitee.form_token.controller;

import com.gitee.form_token.common.Result;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/admin")
@PreAuthorize("@myValid.has('ROLE_admin')")
public class AdminController {

    @PostMapping("/create")
    public Result create() {
        return Result.success("create");
    }

    @GetMapping("/read")
    public Result read() {
        return Result.success("read");
    }

    @PutMapping("/update")
    public Result update() {
        return Result.success("update");
    }

    @DeleteMapping("/delete")
    public Result delete() {
        return Result.success("delete");
    }

}
